Skip to content

UCP/UCT/IB: Add per-endpoint traffic class (DSCP) for RC/RoCE (QOS)#11618

Open
ybenvidia wants to merge 4 commits into
openucx:masterfrom
ybenvidia:dscp-prio
Open

UCP/UCT/IB: Add per-endpoint traffic class (DSCP) for RC/RoCE (QOS)#11618
ybenvidia wants to merge 4 commits into
openucx:masterfrom
ybenvidia:dscp-prio

Conversation

@ybenvidia

Copy link
Copy Markdown

What

Add an optional per-endpoint traffic class that is programmed onto the
RC mlx5 QP, so different endpoints/flows can be tagged with a different
DSCP (RoCEv2) or GRH traffic class (IB) for fabric QoS/arbitration.

Why

QoS use cases (e.g. prioritizing one UCC team / process-group over another)
need to set a distinct DSCP per set of connections. UCX previously only had
a single iface-wide UCX_IB_TRAFFIC_CLASS; there was no way to select the
traffic class per endpoint at connect time.

Changes

  • Public API: new ucp_ep_params.ep_traffic_class field, enabled with
    UCP_EP_PARAM_FIELD_EP_TRAFFIC_CLASS.
  • UCT API: new uct_ep_connect_to_ep_params_t.ep_traffic_class field, enabled
    with UCT_EP_CONNECT_TO_EP_PARAM_FIELD_EP_TRAFFIC_CLASS.
  • Plumbing: ucp_ep_adjust_paramsUCP_EP_FLAG_EP_TRAFFIC_CLASS
    wireup (ucp_wireup_connect_local, ucp_wireup_ep_connect_to_ep_v2) →
    uct_rc_mlx5_iface_common_devx_connect_qp.
  • mlx5 DEVX: write primary_address_path.dscp (RoCEv2) or
    primary_address_path.tclass (IB, when GRH present). When the field is not
    set, behavior is unchanged (falls back to the iface default DSCP/tclass).
  • Sentinels UCP_EP_NO_TCLASS / UCT_EP_NO_TCLASS for "not set".
  • Java binding constant updated.

Compatibility

Fully opt-in and backward compatible: without the field mask bit, the QP is
programmed exactly as before.

Testing

  • ucc_perftest with a per-team traffic class, verified end-to-end:
    the value set at connect time is written to the QP primary_address_path.dscp
    (checked value tracks the input, e.g. 24 → 37).
  • Confirmed on the wire: RoCEv2 packets (UDP 4791) captured with the
    RDMA sniffer show the configured DSCP in the IP header (DSCP 37 → ToS 0x94).
  • 16-rank cross-node run: only the tagged endpoints carry the DSCP; bootstrap/
    service connections keep the default.

@ybenvidia ybenvidia marked this pull request as draft July 5, 2026 07:31
Add an optional per-endpoint traffic class programmed onto the RC mlx5 QP,
so endpoints can be tagged with a distinct DSCP (RoCEv2) or GRH traffic
class (IB) for fabric QoS.

- API: ucp_ep_params.ep_traffic_class + UCP_EP_PARAM_FIELD_EP_TRAFFIC_CLASS
- UCT: uct_ep_connect_to_ep_params_t.ep_traffic_class +
  UCT_EP_CONNECT_TO_EP_PARAM_FIELD_EP_TRAFFIC_CLASS
- Plumb UCP ep params -> wireup -> rc mlx5 devx QP (primary_address_path.dscp
  for RoCEv2, .tclass for IB); default behavior unchanged when unset
- Sentinels UCP_EP_NO_TCLASS / UCT_EP_NO_TCLASS
- Java binding constant
@ybenvidia ybenvidia marked this pull request as ready for review July 7, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant